﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjectN.Core.Fore.Editor
{
    public partial class ColorPicker : UserControl
    {
        public ColorPicker()
        {
            InitializeComponent();
        }

        public Color Color
        {
            get => ColorDialog.Color;
            set => ColorDialog.Color = value;
        }

        private void SelectButton_Click(object sender, EventArgs e)
        {
            var result = ColorDialog.ShowDialog();
            this.RGBLabel.Text = Color.ToArgb().ToString("X8");
            ColorPanel.Invalidate();
        }

        private void ColorPanel_Paint(object sender, PaintEventArgs e)
        {
            var rect = e.ClipRectangle;
            e.Graphics.FillRectangle(new SolidBrush(Color), rect);
        }
    }
}
